Skip to main content

All Questions

3votes
0answers
462views

Making a fast Mandelbrot Fractal viewer

I'm making a Mandelbrot set viewer in JavaFX. It takes a while, like maybe 5 seconds to finish. Here's my code: ...
bychtromae's user avatar
1vote
2answers
286views

"Disease Spread" challenge

Right now I'm solving this problem on codewars.com. I'm not sure about how to optimise the code further. Or is my algorithm inefficient? If it's an algorithmic issue, could someone help me how to go ...
Arvind Prakash's user avatar
1vote
5answers
559views

Optimizing program to output all numbers summing to 100

I just finished my program which calculates the solutions to this problem: Outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. ...
Dragongeek's user avatar
5votes
1answer
2kviews

Rational Polynomial Factoring method

I have written a class containing methods to factor a polynomial equation using the p over q method. The method returns a string that is the factored equation. Here is the class (can also be found ...
Dando18's user avatar
0votes
1answer
2kviews

Eigenvalue calculation for a Java matrix library [closed]

After an interview didn't go smoothly, I decided to write my own library so that I would be better prepared if I'm ever asked about matrix multiplication again. I know that doing it in Java is going ...
Ron T's user avatar
4votes
1answer
2kviews

Pollard p - 1 implementation

I'm trying to implement the Pollard p - 1 algorithm seen here, in Java. It has a C implementation here. I am using it for numbers without any smaller factors so trial factorisation isn't needed. My ...
Benten's user avatar
3votes
2answers
365views

BigRational based on BigIntegers

For Project Euler I've implemented a BigRational. The functionality is rather limited, just things I needed or will probably need soon. The style departs a bit from ...
maaartinus's user avatar
15votes
1answer
2kviews

Multiplication 128 x 64 bits

I was fooling around with the Collatz sequence a bit and found out that long is only sufficient for starting values below ...
maaartinus's user avatar
11votes
3answers
2kviews

Algorithm to calculate semi perfect integers, lack of efficiency

I'm working on an algorithm to calculate weird numbers, and to do so there are several properties that needs to be calculated, one of them being, if it is NOT a semi-perfect/pseudoperfect number. My ...
Linus's user avatar
4votes
1answer
1kviews

Followup: How do I optimize this Java cube root function for BigInteger?

Followup to How do I optimize this Java cube root function for BigInteger? So I've tried several implementations of this algorithm. The version using only BigInteger sometimes results in a never-...
Brian J. Fink's user avatar
7votes
1answer
3kviews

How do I optimize this Java cube root function for BigInteger?

I find that this function is one of the biggest causes of slow program execution. I can write a square root version with BigInteger only, but with the cube root, the algorithm sometimes gets caught in ...
Brian J. Fink's user avatar
6votes
4answers
125views

Calculation of e performance issue

Can you give me some idea how to optimize the switch statements, maybe a for or do while ...
Didi's user avatar
  • 111
0votes
2answers
1kviews

Pythagorean triplets

This code is about finding Pythagorean triplets. I take a number as input, and find from 1 to that number, how many Pythagorean triplets exist. Are there ways this can be optimized? It takes a lot ...
VivekN's user avatar
5votes
3answers
1kviews

Better performance in calculating E

Can you give me some performance advice on how to optimize the time of execution of the following calculation of E? ...
Didi's user avatar
  • 111
8votes
2answers
2kviews

Finding the nearest Rational to a double - is there a more efficient mechanism?

I use the following code to find the lowest denominator Rational that is within a certain delta from a double. The rationale is that the I am pulling float numbers ...
OldCurmudgeon's user avatar

153050per page
close